/* 
 * Amnesia is Copyright (c) 2010 Mark Russell
 * 
 * Contact: info@amnesia-app.com	
 * 
 * This file is part of Amnesia.
 * 
 * Amnesia is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Amnesia is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Amnesia. If not, see <http://www.gnu.org/licenses/>.
 *
 */

// -------------------------------------------------------------
// Amnesia Preferences Code
// -------------------------------------------------------------


$(document).ready(function() {
	// -------------------------------------------------------------
	// Setup page
	// -------------------------------------------------------------
	
	function update() {
	
	user_id = $("input#user_id").attr('value');
	timeout = $("select#timeout").attr('value');
	
	query_string = 'id=' + user_id + '&timeout=' + timeout;
	
		// Call edit.php to make update on db
		$.ajax({
		type: "POST",
		url: "update_user.php",
		data: query_string,
		success: function() {
			$("#prefs_form").hide();
			$("#prefs_done").show();
		}
		});
	}
	
	$("#update_preferences").click(function () {
		update();
	});
		
// Close document.ready
});